<?php

function reequipment_user_report_pm_this_month()
{    
    if (!xarSecurityCheck('EditEquipment', 1)) return;
    $data = array();
     // Get company_id
    if (!xarVarFetch('company_id', 'int:1:', $company_id, '', XARVAR_NOT_REQUIRED)) return; 
	if (!xarModAPIFunc('reequipment', 'user', 'getcompanyid', array('company_id_from_url' => $company_id))) return;
	$company_id = xarSessionGetVar('company_id');
	xarTplSetPageTitle(xarML('Completed PM This Month'));
	// Get PM Data
	$data['pms'] = xarModAPIFunc('reequipment', 'user', 'getmaintenance', array('company_id' => $company_id, 'scheduled' => true, 'date_due' => '+1  	month'));
	// return var_export($data['pms']);
	
    // Company Name
	$data['company_name'] = xarSessionGetVar['company_name'];
    return $data;
}

?>